<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="container">
        <div>
            11111
        </div>
        <div class="box">
            33333
        </div>
    </div>
    <script>
        var faEle = document.querySelector(".container");
        var boxEle = document.querySelector(".box");
        var dicEle = document.querySelector(".container div");
        document.onclick = function (){
            var pEle = document.createElement("p");
            pEle.innerHTML = '我是p' ;
            // faEle.insertBefore(pEle,boxEle);
            // faEle.insertBefore(pEle,dicEle);
            // faEle.appendChild(pEle);
            faEle.replaceChild(pEle,dicEle);
            // var res = faEle.cloneNode(true);
            // faEle.appendChild(res);
            // console.log(res);
        }
    </script>
</body>
</html>